package com.example.demo.Service;

import org.springframework.stereotype.Service;
import redis.clients.jedis.Jedis;

import java.util.Arrays;
import java.util.List;

@Service
public class JedisService {

    private Jedis jedis=new Jedis("127.0.0.1",6379);

    public void put(){
        List list= Arrays.asList("this","is","a","demo");
        jedis.set("jedis:test:list".getBytes(),"Bytes".getBytes());
        jedis.set("jedis:test:string","123");
    }

    public String get(String key){
        return jedis.get(key);
    }

}
